package fr.xelaprod.open.source.android.rss.db;



import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
/**
 * 
 * @author alexandre thery
 *
 */
public class MyNewsDatabase extends SQLiteOpenHelper{

		 
		private static final String TABLES = "my_news_table";
	 
		private static final String CREATE_BDD = "CREATE TABLE " + TABLES + " ("
		+ "id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT);";
	 
		public MyNewsDatabase(Context context, String name, CursorFactory factory, int version) {
			super(context, name, factory, version);
		}
	 
		@Override
		public void onCreate(SQLiteDatabase db) {
			db.execSQL(CREATE_BDD);
		}
	 
		@Override
		public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
			db.execSQL("DROP TABLE " + TABLES + ";");
			onCreate(db);
		}
	
}
